// store/auth.ts
import { defineStore } from "pinia";

export const useAuthStore = defineStore("auth", {
  state: () => ({
    user: null,
    returnUrl: null,
    menuData: [] as any[],
    hasLoadedDynamicRoutes: true, // ✅ 我们已在 router 中处理，不需要再加载
  }),
  actions: {
    // 可以留空，或用于用户登录
    login(userData: any) {
      this.user = userData;
    },
    logout() {
      this.user = null;
      this.menuData = [];
    },
  },
});